import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  topAlbums: [],
  albumNews: [],
  albumNewests: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_TOPALBUM:
      return state.set("topAlbums", action.topAlbums);
    case actionTypes.GET_ALBUMNEW:
      return state.set("albumNews", action.albumNews);
    case actionTypes.GET_ALBUMNEWEST:
      return state.set("albumNewests", action.AlbumNewests);
    default:
      return state;
  }
};

export default a;
